package com.zhouyu.service;

import com.spring.Autowired;
import com.spring.BeanNameAware;
import com.spring.Component;
import com.spring.InitializingBean;
import com.spring.Scope;

/**
 * @Description todo
 * @Author yubao
 * @Date 2021/11/14 12:21
 **/
@Component("userService")
@Scope("prototype")
public class UserServiceImpl implements UserService, BeanNameAware, InitializingBean {

    @Autowired
    private OrderService orderService;

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private String beanName;

    @Override
    public void test() {
        System.out.println("hand write userservice,"+name);
    }

    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }

    @Override
    public void afterPropertiesSet(String beanName) {
        System.out.println("bean初始化");
    }
}
